package com.java.common.to.es;

import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

/**
 * es 索引对应的类型
 *
 *  *         "index": false, 表示不能用来检索
 *  *         "doc_values": false 设置doc_values: false，这个字段将不再支持据聚合、排序和脚本执行
 *
 * PUT product
 * {
 *   "mappings": {
 *     "properties": {
 *       "skuId":{
 *         "type": "long"
 *       },
 *       "spuId":{
 *         "type": "keyword"
 *       },
 *       "skuTitle":{
 *         "type": "text",
 *         "analyzer": "ik_smart"
 *       },
 *       "skuPrice":{
 *         "type": "keyword"
 *       },
 *       "skuImg":{
 *         "type": "keyword",
 *       },
 *       "saleCount":{
 *         "type": "long"
 *       },
 *       "hasStock":{
 *         "type": "boolean"
 *       },
 *       "hotScore":{
 *         "type": "long"
 *       },
 *       "brandId":{
 *         "type": "long"
 *       },
 *       "catalogId":{
 *         "type": "long"
 *       },
 *       "brandName":{
 *         "type": "keyword"
 *       },
 *       "brandImg":{
 *         "type": "keyword"
 *       },
 *       "catalogName":{
 *         "type": "keyword"
 *       },
 *       "attrs":{
 *         "type": "nested",
 *         "properties": {
 *           "attrId":{
 *             "type":"long"
 *           },
 *           "attrName":{
 *             "type":"keyword"
 *           },
 *           "attrValue":{
 *             "type":"keyword"
 *           }
 *         }
 *       }
 *     }
 *   }
 * }
 */

@Data
public class SkuEsModel {
    private Long skuId;
    private Long spuId;
    private String skuTitle;
    private BigDecimal skuPrice;
    private String skuImg;
    private Long saleCount;
    private Boolean hasStock;   //是否有库存
    private Long hotScore;      //热度评分
    private Long brandId;
    private Long catalogId;
    private String brandName;
    private String brandImg;
    private String catalogName;
    private List<AttrEs> attrs;

    @Data
    public static class AttrEs {
        private Long attrId;
        private String attrName;
        private String attrValue;
    }
}
